Object-oriented programming (OOP) has emerged as a powerful new programming paradigm that enables the rapid development and implementation of functionality while permitting the customization and reuse of objects. The Object Management Group (OMG, an international organization for promoting the theory and practice of object-oriented software technology) defines an industry standard architecture for a distributed object computing environment called the Object Management Architecture (OMA). The OMA provides a conceptual infrastructure upon which all of the OMG's specifications are based.
OMG defines a structure to allow integration of a wide variety of object systems called the Common Object Request Broker Architecture (CORBA). The CORBA model consists of the Object Request Broker (ORB), CORBAservices, CORBAfacilities and Application Objects. These components make up the primary pieces of CORBA.
CORBA defines an underlying object model which provides an organized presentation of object concepts and terminology. With the definition of the CORBA object model, along with aspects such as object creation, identity, requests, and operations, is the definition of CORBA Types. CORBA types are identifiable entities to which values can be members, if the type constraints are satisfied. CORBA types are either basic, or constructed. An example of a basic CORBA type is a Boolean, taking values of only TRUE or FALSE. An example of a CORBA constructed type is a sequence, consisting of a variable length array of a single type (basic or constructed), and a length. From the CORBA basic and constructed types, applications can construct arbitrarily complex data types via aggregation (user defined types).
CORBA defines an architected way of describing in complete detail everything that is known about a particular data type, regardless of whether it is a CORBA defined type or a user defined aggregated type, through TypeCodes. TypeCodes conceptually contain a kind field and one or more parameters that contain descriptive information particular to that TypeCode. Utilizing CORBA TypeCodes to express complex data information makes it possible to determine the complete structure of a type. CORBA TypeCodes can be nested and thus represent arbitrarily complex information that has to be manipulated by CORBA applications.
Within distributed object systems, the need arises to express arbitrarily complex data in forms appropriate for interfacing with programming interfaces, or expressing it in stream form. For example, arbitrarily complex data must be provided for transport protocol stacks for computer networking or I/O stream requirements. Since TypeCodes allow interrogation of all information expressed in data types, it is possible to provide procedures for manipulating the data expressed as CORBA TypeCodes both to and from stream forms.
The CORBA marshaling code represents a prior art approach for decomposing CORBA data types into a specific wire-format used to transport information across machines. However, typical marshaling subsystems do not provide mechanisms for releasing and copying allocated memory used to reconstruct the original data types, nor do they make the marshalled data available for public utilization for general purposes. In addition, CORBA marshaling code requires the wire-format marshaled information have indicators of expression for marshaled data elements in order to reconstruct data for the data types appropriate on different platforms.
Consequently, what is needed is a procedure for translating arbitrarily complex CORBA data types for use by CORBA application programs, to and from a general purpose stream format, that is made publicly available to any caller. In addition, the procedure must be capable of freeing memory within arbitrarily complex CORBA data types and making copies of the arbitrarily complex CORBA data types.